#include<bits/stdc++.h>

using namespace std;

void int2str(int n, char a[]) {
    int j = 0;
    do {
        int d = n % 10;
        a[j++] = d + '0';
        n /= 10;
    } while (n > 0);
    reverse(a, a + j);
    a[j] = 0;
}

int main() {
    int n = 12345;

    char s[100];
    int2str(n, s);
    cout << s;
    return 0;
}
